import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//隐去md5加密
import md5 from 'js-md5'
// 引入echarts
import *as echarts from 'echarts'
//引入动画
import animated from 'animate.css'
import axios from "axios"

//引入element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//引入iconfont样式
import '@/assets/iconfont/iconfont.css'
//导入全局组件
import myHeader from '@/components/myHeader/myHeader'
import Paging from "@/components/Paging/Paging"
import Search from "@/components/Search/Search"

//时间组件
import dayjs from 'dayjs'
//导入骨架屏
import VueElementUISkeleton from 'vue-elementui-skeleton'

Vue.prototype.$md5 = md5
Vue.prototype.$dayjs = dayjs
Vue.prototype.$echarts = echarts
Vue.prototype.$axios=axios
axios.defaults.baseURL='http://132.232.110.185/personnelManagement'

//取消vue启动警告
Vue.config.productionTip = false

//使用element-ui
Vue.use(ElementUI);
Vue.use(animated)
//使用骨架屏
Vue.use(VueElementUISkeleton,{
    directiveName: 'skeleton',
    rows: 10,
    radius: 3,
    bg: 'red'
})
//注册全局组件
Vue.component('myHeader', myHeader)
Vue.component('Paging', Paging)
Vue.component('Search', Search)
//背景颜色随机
// 全局指令：背景色就会随机变:在任何组件内都可以使用
Vue.directive("bgc", {
    // 使用时给标签添加v-bgc就可以了
    inserted(el) {
        let a = () => Math.floor(Math.random() * 256);
        el.style.backgroundColor = `rgb(${a()},${a()},${a()})`;
        // 拓展：给dom注册事件
    },
});
// 拿走直接在脚手架中用

const vm=new Vue({
    router,
    store,
    render: h => h(App),
}).$mount('#app')
